<?php
namespace app\index\controller;

use think\Db;                       // db
use think\Session;
use app\common\controller\HomeBase;  // model
use app\common\model\Jumpcategory as AuditcategoryModel;
use app\common\model\Audit as AuditModel;

class Shenhe extends HomeBase
{
    protected $jumpcategory_model;
    protected $audit_model;

    protected function _initialize(){
        parent::_initialize();
        $this->jumpcategory_model = new AuditcategoryModel();
        $this->audit_model = new AuditModel();
        $category_level_list = $this->jumpcategory_model->getLevelList();
        $this->assign('category_level_list',$category_level_list);
    }

    public function index()
    {
        $title_array = array(
            'title'     => '首页'       ,
            'id'     => 1
        );

        $result = $this->audit_model->alias('w')->field('w.*,think_wacategory.name')->where('status',1)->join('think_wacategory','w.wid = think_wacategory.id')->order('w.sort desc')->select();
        $this->assign('wenan_list',$result);
        $this->assign('title','文案列表');
        return $this->fetch();
    }
}
